package com.sky.mapper;

import com.sky.entity.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.Map;

@Mapper
public interface UserMapper {


    /**
     * 根据openid查询
     * @param openid
     * @return
     */
    @Select("select * from abeibei_story.user where openid =#{openid}")
    User getByOpenid (String openid);


    /**
     * 插入数据
     * @param byOpenid
     */
    void insert(User byOpenid);

    @Select("select * from abeibei_story.user where id=#{Id}")
    User getById(Long userId);

    /**
     * 根据日期查用户数据
     * @param map
     * @return
     */
    Integer countByMap(Map map);
}
